﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PersonForm.ascx.cs" Inherits="AcademicPlanner.Presentation.Views.Shared.PersonForm" %>
<%@ Import Namespace="AcademicPlanner.Framework.Libraries.Mvc" %>
<%@ Import Namespace="AcademicPlanner.Framework.Helpers" %>
<%@ Import Namespace="AcademicPlanner.Presentation" %>
<%@ Import Namespace="AcademicPlanner.Presentation" %>
<%@ Import Namespace="AcademicPlanner.Presentation.Views.Shared" %>

<% if (!Model.IsSub)
   { %>
		<div class="form yui-skin-sam">
		<% Begin(); %>
<% } %>

<% if (!string.IsNullOrEmpty(Title))
   { %>
		<fieldset><legend><%= Html.Encode(Title) %></legend>
<% } %>

<% if (!Model.IsSub)
   { %>
		<%= WidgetHelper.FormErrorsBlock("", Model.Id + "Errors", "hidden")%>
<% } %>



<% if (Model.Scenario.Equals(PersonFormScenario.COMPLETE_REGISTRATION))
   {
	%>
		<fieldset>
			<legend><%= Tr("Personal Information") %></legend>
			<div class="rows-wrapper">
				<div class="row">
					<div class="cell label">
						<%= Html.Label(GetFieldName("Email"), Html.Encode(Tr(Labels.Get("Email", "Person"))))%>
					</div>
					<div class="cell">
						<i><%= Html.Encode(EmailValue)%></i>
					</div>
				</div>
				<div class="row">
					<div class="cell label">
						<%= Html.Label(GetFieldName("Name"), Html.Encode(Tr(Labels.Get("Name", "Person"))), true)%>
					</div>
					<div class="cell">
						<%= Html.TextField(GetFieldName("Name"), NameValue) %>
					</div>
				</div>
			</div>
		</fieldset>
		<% Html.RenderPartial("AccountForm", SaveAccountModel); %>
<% }
   else if (Model.Scenario.Equals(PersonFormScenario.EDIT))
   {
	%>
		<div class="rows-wrapper">
			<div class="row">
				<div class="cell label">
					<%= Html.Label(GetFieldName("Email"), Html.Encode(Tr(Labels.Get("Email", "Person"))))%>
				</div>
				<div class="cell">
					<i><%= Html.Encode(EmailValue)%></i>
				</div>
			</div>
			<div class="row">
				<div class="cell label">
					<%= Html.Label(GetFieldName("Name"), Html.Encode(Tr(Labels.Get("Name", "Person"))), true)%>
				</div>
				<div class="cell">
					<%= Html.TextField(GetFieldName("Name"), NameValue) %>
				</div>
			</div>
		</div>
<% }
   else if (Model.Scenario.Equals(PersonFormScenario.REGISTER)
			|| Model.Scenario.Equals(PersonFormScenario.FORGOT_PASSWORD))
   {
	%>
		<div class="rows-wrapper">
			<div class="row">
				<div class="cell label">
					<%= Html.Label(GetFieldName("Email"), Html.Encode(Tr(Labels.Get("Email", "Person"))), true)%>
				</div>
				<div class="cell">
					<%= Html.TextField(GetFieldName("Email"), EmailValue)%>
				</div>
			</div>
		</div>
<% } %>



<% if (!Model.IsSub)
   { %>
		<div class="rows-wrapper action">
			<div class="row">
				<div class="cell label">
					&nbsp;
				</div>
				<div class="cell">
					<%= Html.SubmitButton("submitForm", Html.Encode(SubmitButtonValue), "") %>
				</div>
			</div>
		</div>
<% } %>


<% if (!string.IsNullOrEmpty(Title))
   { %>
		</fieldset>
<% } %>


<% if (!Model.IsSub)
   { %>
		<% End(); %>
		</div>
<% } %>